package com.hsnn.medstgmini.pro.project.controller;


import java.io.IOException;
import java.lang.reflect.Type;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableEntryException;
import java.security.cert.CertificateException;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.crypto.SecretKey;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import com.hsnn.medstgmini.Constants;
import com.hsnn.medstgmini.base.std.model.StdCompinfo;
import com.hsnn.medstgmini.crypto.CryptoUtil;
import com.hsnn.medstgmini.crypto.KeyStoreUtil;
import com.hsnn.medstgmini.crypto.impl.CryptoManagerImpl;
import com.hsnn.medstgmini.pro.project.model.BidProject;
import com.hsnn.medstgmini.pro.project.model.form.ProdProjectForm;
import com.hsnn.medstgmini.pro.project.service.BidProjectManager;
import com.hsnn.medstgmini.pro.project.service.DrugPriceQuoteManager;
import com.hsnn.medstgmini.sys.model.SysUser;
import com.hsnn.medstgmini.util.Pagination;
import com.hsnn.medstgmini.util.ParseDate;

/**
 * @category 药品价格申报
 * @author wangbing
 * @date 2015年8月26日
 */
@Controller
@RequestMapping("/drugPriceQuote")
public class DrugPriceQuoteController {

	private static final Logger logger = Logger
			.getLogger(DrugPriceQuoteController.class);


	@Autowired
	private DrugPriceQuoteManager drugPriceQuoteManager;

	@Autowired
	private BidProjectManager bidProjectManager;

	@Autowired
	private HttpServletRequest request;

	@Autowired
	private HttpSession session;
	
	@Value("#{sysProp['system.province']}")
    private String sysProvince;
	
	@Value("#{sysProp['system.keystore.filepath']}")
    private String keystoreFilepath;

	/**
	 * @category 获取当前登陆人信息
	 * @author 言科
	 * @date 2015年7月22日 SysUser
	 */
	public SysUser getUser() {
		return (SysUser) session.getAttribute(Constants.USERINFO);
	}
	
	/**
	 * @category 获取KeyStore密钥
	 * @author wangbing
	 * @throws IOException 
	 * @throws UnrecoverableEntryException 
	 * @throws CertificateException 
	 * @throws NoSuchAlgorithmException 
	 * @throws KeyStoreException 
	 * @date 2015年7月22日 SecretKey
	 */
	public SecretKey getSK() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableEntryException, IOException {
		SecretKey sk = KeyStoreUtil.getSecretKey(session.getServletContext()
							.getRealPath(keystoreFilepath), sysProvince,"secretKeyAlias");
		return sk;
	}
	
	/**
	 * @category 获取报价解密密钥
	 * @author wangbing
	 * @throws Exception 
	 * @date 2015年7月22日 String
	 *  page中放入projId  键值对
	 */
	@SuppressWarnings("unchecked")
	public String getDecryptPassword(Pagination page) throws Exception {
		StdCompinfo compInfo = getUser().getInfo();
		String compId = "";
		if (compInfo != null) {
			compId = compInfo.getCompId();
		}
		
		if(StringUtils.isNotBlank(compId)){
			page.getConditions().put("compId", compId.trim());
		}
		// 获取KeyStore密钥
		SecretKey sk = getSK();
		//获取加密密钥
		Map<String,String> map =(Map<String,String>) drugPriceQuoteManager.getPassword(page).getRows();
		String key = map.get("pricePassword");
						
		if(StringUtils.isNotBlank(key)){
			//解码
			byte[] bt = CryptoUtil.decode(key);
			//解密
			String decryptPassword = CryptoManagerImpl.decrypt(sk, bt);
			return decryptPassword;
		}
		return null;		
						
	}

	/**
	 * @category 跳转药品价格申报项目列表页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toDrugPriceQuoteProjList")
	public String toDrugPriceQuoteProjList() {
		logger.info("enter toDrugPriceQuoteProjList method!");
		String projId = getUser().getDefaultProjId();
		if(StringUtils.isNotBlank(projId)){
			
			String name = bidProjectManager.getBidProjectById(projId).getName();
			request.setAttribute("projId", projId);
			request.setAttribute("name", name);
			return "/pro/project/checkDefaultPassword";
		}
		request.setAttribute("date", ParseDate.parseFullFormat(new Date()));
		return "/pro/project/drugPriceQuoteProjList";
	}
	
	/**
	 * @category 查看有没有密码
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping("/seePassword")
	@ResponseBody
	public Pagination seePassword() {
		Pagination page = new Pagination();
		String projId = request.getParameter("projId");
		if(StringUtils.isNotBlank(projId)){
			page.getConditions().put("projId", projId.trim());
		}
		StdCompinfo compInfo = getUser().getInfo();
		String compId = "";
		if (compInfo != null) {
			compId = compInfo.getCompId();
		}
		
		if(StringUtils.isNotBlank(compId)){
			page.getConditions().put("compId", compId.trim());
		}
		try {
			Map<String,String> map =(Map<String,String>) drugPriceQuoteManager.getPassword(page).getRows();
			if(StringUtils.isNotBlank(map.get("pricePassword"))){
				page.setSuccess(true);
			}else{
				page.setSuccess(false);
				page.setMsg("请设置密码后再来报价！");
			}
		} catch (Exception e) {
			page.setSuccess(false);
			page.setMsg("数据异常！");
			e.printStackTrace();
		}
		return page;
	}
	/**
	 * @category 跳转输入密码页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toWritePassword")
	public String toWritePassword() {
		logger.info("enter toWritePassword method!");
		request.setAttribute("projId", request.getParameter("projId"));
		return "/pro/project/writePriceQuotePassword";
	}
	
	/**
	 * @category 验证密码
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@RequestMapping("/validatePassword")
	@ResponseBody
	public Pagination validatePassword() {
		Pagination page = new Pagination();
		String projId = request.getParameter("projId");
		String password = request.getParameter("password");
		if(StringUtils.isNotBlank(password)){
			page.getConditions().put("password", password.trim());
		}else{
			password = "";
		}
		if(StringUtils.isNotBlank(projId)){
			page.getConditions().put("projId", projId.trim());
		}
		StdCompinfo compInfo = getUser().getInfo();
		String compId = "";
		if (compInfo != null) {
			compId = compInfo.getCompId();
		}
		
		if(StringUtils.isNotBlank(compId)){
			page.getConditions().put("compId", compId.trim());
		}
		
		try {
				//获取解密密码
				String decryptPassword = getDecryptPassword(page);
				//验证输入的密码是否正确
				if(StringUtils.isNotBlank(decryptPassword)){
					if(decryptPassword.equals(password)){
						page.setSuccess(true);
					}else{
						page.setSuccess(false);
						page.setMsg("密码错误!");
					}
				}else{
					page.setMsg("数据异常!");
					page.setSuccess(false);
				}
		} catch (Exception e) {
			page.setSuccess(false);
			page.setMsg("数据异常!");
			e.printStackTrace();
		}
							
		return page;
	}
	
	/**
	 * @category 跳转报价药品列表页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toDrugPriceQuoteList")
	public String toDrugPriceQuoteList() {
		logger.info("enter toDrugPriceQuoteList method!");
		request.setAttribute("projId", request.getParameter("projId"));
		return "/pro/project/drugPriceQuoteList";
	}

	

	

	/**
	 * @category 查询项目列表
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@RequestMapping("/getDrugPriceQuoteProjList")
	@ResponseBody
	public Pagination getDrugPriceQuoteProjList(ProdProjectForm form) {
		Pagination page = new Pagination(request);
		try {
			SysUser user = getUser();
			page.setForm(form);
			drugPriceQuoteManager.getDrugPriceQuoteProjList(page, user);
			page.setSuccess(true);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(e);
			page.setSuccess(false);
		}
		return page;
	}
	
	/**
	 * @category 报价药品列表
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping("/getDrugPriceQuoteList")
	@ResponseBody
	public Pagination getDrugPriceQuoteList() {
		Pagination page = new Pagination(request);
		String qualityspecName = request.getParameter("qualityspecName");
		String qualityspecCode = request.getParameter("qualityspecCode");
		String projId = request.getParameter("projId");
		if(StringUtils.isNotBlank(qualityspecName)){
			page.getConditions().put("qualityspecName", qualityspecName.trim());
		}
		if(StringUtils.isNotBlank(qualityspecCode)){
			page.getConditions().put("qualityspecCode", qualityspecCode.trim());
		}
		if(StringUtils.isNotBlank(projId)){
			page.getConditions().put("projId", projId);
		}
		
		StdCompinfo compInfo = getUser().getInfo();
		String compId = "";
		if (compInfo != null) {
			compId = compInfo.getCompId();
		}
		
		if(StringUtils.isNotBlank(compId)){
			page.getConditions().put("compId", compId.trim());
		}
		
		try {
			SysUser user = getUser();
			//获取解密密钥
			String decryptPassword = getDecryptPassword(page);
			drugPriceQuoteManager.getDrugPriceQuoteList(page, user);
			List<Map<String,String>> list = (List<Map<String, String>>) page.getRows();
			if(list!=null&&list.size()>0){
				for(int i=0;i<list.size();i++){
					String encryptPrice = list.get(i).get("encryptPrice");
					if(StringUtils.isNotBlank(encryptPrice)){
						//解码
						byte[] bt = CryptoUtil.decode(encryptPrice);
						//解密
						list.get(i).put("encryptPrice", CryptoManagerImpl.decrypt(decryptPassword, bt));
					}
					
				}
				page.setRows(list);
			}
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(e);
		}
		return page;
	}
	
	/**
	 * @category 保存报价
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@RequestMapping("/saveEncryptPrice")
	@ResponseBody
	public Pagination saveEncryptPrice() {
		logger.info("enter saveEncryptPrice method!");
		Pagination page = new Pagination();
		String array = request.getParameter("array");
		try {
			if (StringUtils.isNotBlank(array)) {
				
				Gson gson = new Gson();
				Type type = new TypeToken<List<Map<String,String>>>() {
				}.getType();
				List<Map<String,String>> list = gson.fromJson(array, type);
				if (list != null && list.size()>0) {
					page.setForm(getUser());
					StdCompinfo compInfo = getUser().getInfo();
					String compId = "";
					if (compInfo != null) {
						compId = compInfo.getCompId();
					}
					
					if(StringUtils.isNotBlank(compId)){
						page.getConditions().put("compId", compId.trim());
					}
					String encryptPrice = "";
					String decryptPassword = "";
					for(int i=0;i<list.size();i++){
						page.getConditions().put("projId",list.get(i).get("projId"));
						//获取解密密码
						decryptPassword = getDecryptPassword(page);
						if(StringUtils.isNotBlank(decryptPassword)){
							//用解密密码加密价格
							encryptPrice = CryptoUtil.encode(CryptoManagerImpl.encrypt(decryptPassword, list.get(i).get("encryptPrice")));
						}else{
							page.setSuccess(false);
							return page;
						}
						page.getConditions().put("projProddrugId",list.get(i).get("projProddrugId"));
						page.getConditions().put("encryptPrice",encryptPrice);
						drugPriceQuoteManager.saveEncryptPrice(page);
					}
				}
			}else{
				page.setSuccess(false);
				return page;
			}
			page.setSuccess(true);
		} catch (JsonSyntaxException e) {
			e.printStackTrace();
			page.setSuccess(false);
		} catch(Exception e){
			e.printStackTrace();
			page.setSuccess(false);
		}
		return page;
	}
	//*************************药品价格解密
	/**
	 * @category 跳转药品价格解密项目列表页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toDrugPriceDecryptProjList")
	public String toDrugPriceDecryptProjList() {
		logger.info("enter toDrugPriceDecryptProjList method!");
		String projId = getUser().getDefaultProjId();
		if(StringUtils.isNotBlank(projId)){
			
			String name = bidProjectManager.getBidProjectById(projId).getName();
			request.setAttribute("projId", projId);
			request.setAttribute("name", name);
			return "/pro/project/decryptCheckDefaultPassword";
		}
		request.setAttribute("date", ParseDate.parseFullFormat(new Date()));
		return "/pro/project/drugPriceDecryptProjList";
	}
	
	/**
	 * @category 解密查看有没有密码
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping("/decryptSeePassword")
	@ResponseBody
	public Pagination decryptSeePassword() {
		Pagination page = new Pagination();
		String projId = request.getParameter("projId");
		if(StringUtils.isNotBlank(projId)){
			page.getConditions().put("projId", projId.trim());
		}
		StdCompinfo compInfo = getUser().getInfo();
		String compId = "";
		if (compInfo != null) {
			compId = compInfo.getCompId();
		}
		
		if(StringUtils.isNotBlank(compId)){
			page.getConditions().put("compId", compId.trim());
		}
		try {
			Map<String,String> map =(Map<String,String>) drugPriceQuoteManager.getPassword(page).getRows();
			if(StringUtils.isNotBlank(map.get("pricePassword"))){
				page.setSuccess(true);
			}else{
				page.setSuccess(false);
				page.setMsg("请设置密码后再来解密！");
			}
		} catch (Exception e) {
			page.setSuccess(false);
			page.setMsg("数据异常！");
			e.printStackTrace();
		}
		return page;
	}
	
	/**
	 * @category 跳转解密输入密码页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toWriteDecryptPassword")
	public String toWriteDecryptPassword() {
		logger.info("enter toWriteDecryptPassword method!");
		request.setAttribute("projId", request.getParameter("projId"));
		return "/pro/project/writePriceDecryptPassword";
	}
	
	/**
	 * @category 跳转解密药品价格列表页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toDrugPriceDecryptList")
	public String toDrugPriceDecryptList() {
		logger.info("enter toDrugPriceDecryptList method!");
		try {
			BidProject proj = bidProjectManager.getBidProjectById(request.getParameter("projId"));
			request.setAttribute("projName", proj.getName());
			request.setAttribute("projId", request.getParameter("projId"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "/pro/project/drugPriceDecryptList";
	}
	
	/**
	 * @category 药品报价解密列表
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping("/getDrugPriceDecryptList")
	@ResponseBody
	public Pagination getDrugPriceDecryptList() {
		Pagination page = new Pagination(request);
		String qualityspecName = request.getParameter("qualityspecName");
		String qualityspecCode = request.getParameter("qualityspecCode");
		String projId = request.getParameter("projId");
		if(StringUtils.isNotBlank(qualityspecName)){
			page.getConditions().put("qualityspecName", qualityspecName.trim());
		}
		if(StringUtils.isNotBlank(qualityspecCode)){
			page.getConditions().put("qualityspecCode", qualityspecCode.trim());
		}
		if(StringUtils.isNotBlank(projId)){
			page.getConditions().put("projId", projId);
		}
		
		StdCompinfo compInfo = getUser().getInfo();
		String compId = "";
		if (compInfo != null) {
			compId = compInfo.getCompId();
		}
		
		if(StringUtils.isNotBlank(compId)){
			page.getConditions().put("compId", compId.trim());
		}
		
		try {
			SysUser user = getUser();
			//获取解密密钥
			String decryptPassword = getDecryptPassword(page);
			drugPriceQuoteManager.getDrugPriceEncrypList(page, user);
			List<Map<String,String>> list = (List<Map<String, String>>) page.getRows();
			if(list!=null&&list.size()>0){
				for(int i=0;i<list.size();i++){
					String encryptPrice = list.get(i).get("encryptPrice");
					if(StringUtils.isNotBlank(encryptPrice)){
						//解码
						byte[] bt = CryptoUtil.decode(encryptPrice);
						//解密
						list.get(i).put("encryptPrice", CryptoManagerImpl.decrypt(decryptPassword, bt));
					}
					
				}
				page.setRows(list);
			}
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(e);
		}
		return page;
	}
	
	/**
	 * @category 跳转解密药品价格详情列表页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toDrugPriceDecryptDetailList")
	public String toDrugPriceDecryptDetailList() {
		logger.info("enter toDrugPriceDecryptDetailList method!");
		try {
			BidProject proj = bidProjectManager.getBidProjectById(request.getParameter("projId"));
			request.setAttribute("projName", proj.getName());
			request.setAttribute("projId", request.getParameter("projId"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "/pro/project/drugPriceDecryptDetailList";
	}
	
	
	/**
	 * @category 跳转开始 解密价格页面
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/toStartDecryptPrice")
	public String toStartDecryptPrice() {
		logger.info("enter toStartDecryptPrice method!");
		request.setAttribute("projId", request.getParameter("projId"));
		request.setAttribute("datetime", ParseDate.parseFullFormat(new Date()));
		return "/pro/project/startDecryptPrice";
	}
	
	/**
	 * @category 开始解密
	 * @date 2015年8月26日
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping("/decryptPrice")
	@ResponseBody
	public Pagination decryptPrice() {
		int i = 0;
		Pagination page = new Pagination();
		String projId = request.getParameter("projId");
		try {
			page.getConditions().put("projId", projId);
			page.setForm(getUser());
			//获取解密密钥
			String decryptPassword = getDecryptPassword(page);
			drugPriceQuoteManager.getStartDecryptData(page);
			List<Map<String,String>>  dataList = (List<Map<String, String>>) page.getRows();
			if(dataList!=null&&dataList.size()>0){
				for(i=0;i<dataList.size();i++){
					String encryptPrice = dataList.get(i).get("encryptPrice");
					//解码
					byte[] bt = CryptoUtil.decode(encryptPrice);
					//解密
					page.getConditions().put("decryptPrice", CryptoManagerImpl.decrypt(decryptPassword, bt));
					page.getConditions().put("decryptDatetime",ParseDate.parseFullFormat(new Date()));
					page.getConditions().put("projProddrugId",dataList.get(i).get("projProddrugId"));
					drugPriceQuoteManager.startDecryptPrice(page);
					page.getConditions().put("dataLength", i+1+"");
				}
				page.setSuccess(true);
			}else{
				page.setMsg("0");
				page.getConditions().put("dataLength", i+"");
				page.setSuccess(false);
			}
		} catch (Exception e) {
			page.getConditions().put("dataLength", i+"");
			page.setMsg("数据异常!");
			page.setSuccess(false);
			e.printStackTrace();
		}
		return page;
	}
	
	/**
	 * @category 获取解密数据
	 * @date 2015年8月26日
	 * @return
	 */
	@RequestMapping("/getDecryptData")
	@ResponseBody
	public Pagination getDecryptData() {
		Pagination page = new Pagination();
		String projId = request.getParameter("projId");
		String datetime = request.getParameter("datetime");
		try {
			if(StringUtils.isNotBlank(datetime)){
				page.getConditions().put("projId", projId);
				page.getConditions().put("datetime", datetime);
				page.setForm(getUser());
				drugPriceQuoteManager.getDecryptData(page);
				page.setSuccess(true);
			}else{
				page.setSuccess(false);
				return page;
			}
			
		} catch (Exception e) {
			page.setSuccess(false);
			e.printStackTrace();
		}
		return page;
	}
	
	/**
	 * @category 药品报价解密详情列表
	 * @date 2015年9月6日
	 * @param form
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping("/getDrugPriceDecryptDetailList")
	@ResponseBody
	public Pagination getDrugPriceDecryptDetailList() {
		Pagination page = new Pagination(request);
		String qualityspecName = request.getParameter("qualityspecName");
		String qualityspecCode = request.getParameter("qualityspecCode");
		String projId = request.getParameter("projId");
		if(StringUtils.isNotBlank(qualityspecName)){
			page.getConditions().put("qualityspecName", qualityspecName.trim());
		}
		if(StringUtils.isNotBlank(qualityspecCode)){
			page.getConditions().put("qualityspecCode", qualityspecCode.trim());
		}
		if(StringUtils.isNotBlank(projId)){
			page.getConditions().put("projId", projId);
		}
		
		StdCompinfo compInfo = getUser().getInfo();
		String compId = "";
		if (compInfo != null) {
			compId = compInfo.getCompId();
		}
		
		if(StringUtils.isNotBlank(compId)){
			page.getConditions().put("compId", compId.trim());
		}
		
		try {
			SysUser user = getUser();
			//获取解密密钥
			String decryptPassword = getDecryptPassword(page);
			drugPriceQuoteManager.getDrugPriceQuoteList(page, user);
			List<Map<String,String>> list = (List<Map<String, String>>) page.getRows();
			if(list!=null&&list.size()>0){
				for(int i=0;i<list.size();i++){
					String encryptPrice = list.get(i).get("encryptPrice");
					if(StringUtils.isNotBlank(encryptPrice)){
						//解码
						byte[] bt = CryptoUtil.decode(encryptPrice);
						//解密
						list.get(i).put("encryptPrice", CryptoManagerImpl.decrypt(decryptPassword, bt));
					}
					
				}
				page.setRows(list);
			}
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(e);
		}
		return page;
	}
	
	//*************************解密价格公示
		/**
		 * @category 跳转解密价格公示列表页面
		 * @date 2015年8月26日
		 * @return
		 */
		@RequestMapping("/toDrugPriceDecryptPubList")
		public String toDrugPriceDecryptPubList() {
			logger.info("enter toDrugPriceDecryptPubList method!");
			String projId = getUser().getDefaultProjId();
			request.setAttribute("projId", projId);
			return "/pro/project/drugPriceDecryptPubList";
		}
		
		/**
		 * @category 解密价格公示列表
		 * @date 2015年8月26日
		 * @return
		 */
		@RequestMapping("/getDrugPriceDecryptPubList")
		@ResponseBody
		public Pagination getDrugPriceDecryptPubList() {
			logger.info("enter getDrugPriceDecryptPubList method!");
			Pagination page = new Pagination(request);
			String qualityspecName = request.getParameter("qualityspecName");
			String qualityspecCode = request.getParameter("qualityspecCode");
			String projId = request.getParameter("projId");
			String prodCompName = request.getParameter("prodCompName");
			if(StringUtils.isNotBlank(qualityspecName)){
				page.getConditions().put("qualityspecName", qualityspecName.trim());
			}
			if(StringUtils.isNotBlank(qualityspecCode)){
				page.getConditions().put("qualityspecCode", qualityspecCode.trim());
			}
			if(StringUtils.isNotBlank(projId)){
				page.getConditions().put("projId", projId.trim());
			}
			if(StringUtils.isNotBlank(prodCompName)){
				page.getConditions().put("prodCompName", prodCompName.trim());
			}
			try {
				drugPriceQuoteManager.getDrugPriceDecryptPubList(page);
			} catch (Exception e) {
				e.printStackTrace();
			}
			return page;
		}
}
